Skip to content

chore(cli): track output_format and fix is_agent CI parity#5513

Merged
jgoux merged 4 commits into
developfrom
pamela/growth-912-output-format-and-detection-parity
Jun 9, 2026
Merged

chore(cli): track output_format and fix is_agent CI parity#5513
jgoux merged 4 commits into
developfrom
pamela/growth-912-output-format-and-detection-parity

Conversation

@pamelachia

Copy link
Copy Markdown
Contributor

Summary

Adds an output_format property to the cli_command_executed telemetry event and fixes a Go/TS divergence in how is_agent is computed. Together these make the JSON-vs-human output choice measurable and ensure both CLI shells agree on what counts as an agent. This is the measurement-and-parity groundwork for auto-switching agents to JSON output (next subissue under GROWTH-806).

Changes

  • Record the resolved output format on every cli_command_executed. Added output_format to the Go catalog (events.go) and its TS mirror (event-catalog.ts), and emit it from the Go capture and both TS instrumentation paths. db query resolves its format into a command-local flag, so it now mirrors the resolved value onto the global that telemetry reads, keeping the value accurate for the highest-volume agent command. The property does not exist today, so current JSON usage is unmeasurable without it.
  • Fix is_agent Go/TS parity. The TS legacy analytics layer folded CI into is_agent (is_agent = aiTool || isCi), tagging CI environments as agents while the Go binary does not. is_agent now reflects coding-agent detection only, matching Go on both shells. is_ci continues to be reported as its own separate property.

Notes for reviewers

  • output_format values are shell-native (Go: pretty|json|yaml|toml|env; TS: text|json|stream-json), disambiguated by $lib; normalize in analysis.
  • Deliberately out of scope: aligning the CI env-var lists across the two shells. runtime.isCi gates behavior in legacy-platform-api.layer.ts, so changing those lists would alter non-interactive behavior for some CI environments. That belongs in a separate change, not this telemetry-parity fix.
  • The three instrumentation/platform-api unit tests now provide a mock Output because the instrumentation reads output.format.

Linear

  • fixes GROWTH-912
  • parent GROWTH-806

@pamelachia pamelachia requested a review from a team as a code owner June 8, 2026 16:17
@pamelachia pamelachia self-assigned this Jun 8, 2026
@coveralls

coveralls commented Jun 8, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27192135150

Warning

No base build found for commit ff3482b on develop.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 64.268%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 16151
Covered Lines: 10380
Line Coverage: 64.27%
Coverage Strength: 7.04 hits per line

💛 - Coveralls

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Supabase CLI preview

npx --yes https://pkg.pr.new/supabase@5513

Preview package for commit ad6702a.

@jgoux

jgoux commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Thanks Pam. I pushed a small follow-up to fix the legacy TS telemetry path.

The issue was that several legacy commands emit Go-style machine output via --output json|yaml|toml|env, but they intentionally keep the TS Output service in text mode so raw output stays byte-compatible with Go. That meant reading output.format would report text even when the command actually emitted JSON/YAML/TOML/ENV.

The follow-up now resolves output_format from the legacy --output flag when it is a Go machine format, and falls back to the TS output format otherwise. I kept --output pretty as a fallback case because it defers to the active TS output mode, e.g. --output pretty --output-format json.

@jgoux jgoux enabled auto-merge (squash) June 9, 2026 07:56
@jgoux jgoux merged commit 9eebd54 into develop Jun 9, 2026
26 checks passed
@jgoux jgoux deleted the pamela/growth-912-output-format-and-detection-parity branch June 9, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants